home *** CD-ROM | disk | FTP | other *** search
- TITLE NOCURSOR -- Making the Cursor Disappear.
-
- TRUE EQU 01H ; boolean true
- FALSE EQU 00H ; boolean false
- VIDEO_IO EQU 10H ; BIOS video I/O routine
- SET_CURSOR_TYPE EQU 01H ; cursor type option
- SET_CURSOR_POS EQU 02H ; cursor positon opt
-
- NOCURSOR SEGMENT PUBLIC 'CODE'
- ASSUME CS:NOCURSOR
- ASSUME DS:NOTHING
-
- COLOR_ADAPTER DB TRUE ; change if you have mono
-
- ; CURSOR_HIDE hides the cursor by telling the BIOS to
- ; position it one line below the bottom of the display.
-
- PUBLIC CURSOR_HIDE
- CURSOR_HIDE PROC FAR
- PUSH AX ; save registers
- PUSH DX
- PUSH BX
- MOV DH,25 ; set row for cursor
- MOV DL,0 ; set column for cursor
- MOV BH,0 ; set video page
- MOV AH,SET_CURSOR_POS ; cursor position option
- INT VIDEO_IO ; call BIOS video I/O
- POP BX ; restore registers
- POP DX
- POP AX
- RET
- CURSOR_HIDE ENDP
-
- ; CURSOR_SHRINK shrinks the cursor down to nothing by telling
- ; BIOS that the cursor starts and stops on scan line 14 for the
- ; monochrome adapter and scan line 8 for the color adapter.
-
- PUBLIC CURSOR_SHRINK
- CURSOR_SHRINK PROC FAR
- PUSH AX ; save registers
- PUSH CX
- MOV CH,0EH ; cursor start reg: mono
- MOV CL,0EH ; cursor end reg : mono
- CMP COLOR_ADAPTER,TRUE ; color adapter active?
- JNE C1 ; no, mono start & end
- MOV CH,08H ; cursor start reg: color
- MOV CL,08H ; cursor end reg: color
- C1: MOV AH,SET_CURSOR_TYPE ; set cursor type option
- INT VIDEO_IO ; call BIOS video I/O
- POP CX ; restore registers
- POP AX
- RET
- CURSOR_SHRINK ENDP
-
- ; CURSOR_DISAPPEAR reliably makes the cursor disappear by using
- ; an undocumented feature of the BIOS video routine.
-
- PUBLIC CURSOR_DISAPPEAR
- CURSOR_DISAPPEAR PROC FAR
- PUSH AX ; save registers
- PUSH CX
- MOV CH,00100000B ; bit 5 on, bit 6 off
- MOV AH,SET_CURSOR_TYPE ; set cursor type option
- INT VIDEO_IO ; call BIOS video I/O
- POP CX ; restore registers
- POP AX
- RET
- CURSOR_DISAPPEAR ENDP
-
- NOCURSOR ENDS
- END
-